package kzy.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import kzy.entiy.DishFlavor;
import kzy.mapper.DishFlavorMapper;
import kzy.service.DishFlavorService;
import org.springframework.stereotype.Service;

/**
 * @Author 大溪地
 * @create 2023年05月27日14:20
 */
@Service
public class DishFlavorServiceImpl extends ServiceImpl<DishFlavorMapper, DishFlavor> implements DishFlavorService {
    @Override
    public void updateDish(DishFlavor dishFlavor) {
        //构造条件构造器
        LambdaQueryWrapper<DishFlavor> queryWrapper = new LambdaQueryWrapper<>();
        //添加过滤条件 添加删除条件
        queryWrapper.eq( DishFlavor::getDishId,dishFlavor.getDishId());
//        调用父方法删除 满足条件的数据
        super.remove(queryWrapper);
    }
}
